<?php
 /*********************************************\
 |* @author Yannic Schnetz, Mike Waldvogel    *|
 |* @copyright Yannic Schnetz, Mike Waldvogel *|
 |*********************************************|
 |* @since 30.07.2013                         *|
 \*********************************************/

$rooms = array();
$roomsQuery = $DB->query("SELECT * FROM `zimmer` ORDER BY `name` ASC") or die($DB->last_error);
while($row = $DB->fetch($roomsQuery)) {
    $row['description'] = Functions::defilter_text($row['description']);
    $row['randomimg'] = $DB->fetch("SELECT `name` FROM `images` WHERE `type` = 'zimmer' AND `detail_id` = '" . $row['id'] . "' ORDER BY RAND() LIMIT 1");
    $rooms[] = $row;
}

$tpl->assign('rooms', $rooms);
?>
